//
//  Page.m
//  BookMaker
//
//  Created by Mathieu Tozer on 22/11/07.
//  Copyright 2007 plasq. All rights reserved.
//

#import "Page.h"


@implementation Page

- (void)setOrder:(int)order
{
	[self setPrimitiveValue:[NSNumber numberWithInt:order] forKey:@"order"];
}

- (void)awakeFromInsert
{
	[self setPageRect:NSMakeRect(0.0, 0.0, 100, 50)];
}

- (NSString *)pageRectString
{
	return [self primitiveValueForKey:@"pageRect"];
}

- (NSRect)pageRect
{
	return NSRectFromString([self primitiveValueForKey:@"pageRect"]);
}

- (void)setPageRect:(NSRect)rect
{
	[self setPrimitiveValue:NSStringFromRect(rect) forKey:@"pageRect"];
}

- (NSNumber *)xPosition
{
	return [NSNumber numberWithFloat:[self pageRect].origin.x];
}

@end
